/**
 * A node for use in the sparse matrix implementation
 * 
 * !!!!! DO NOT MODIFY THIS FILE !!!!!
 */

public class Node
{
	
	/* The data stored in the node */
	private double data;
	/* The node's row and column coordinates in the matrix */
	private int row, col;
	/* The next node in this node's row and column, respectively */
	private Node rowNext, colNext;
	
	public Node(int row, int col, double data)
	{
		setData(data);
		setRow(row);
		setCol(col);
		setRowNext(null);
		setColNext(null);
	}
	
	public void setData(double newData)
	{
		this.data = newData;
	}
	
	public double getData()
	{
		return this.data;
	}
	
	public void setRow(int newRow)
	{
		this.row = newRow;
	}
	
	public int getRow()
	{
		return this.row;
	}
	
	public void setCol(int newCol)
	{
		this.col = newCol;
	}
	
	public int getCol()
	{
		return this.col;
	}
	
	public void setRowNext(Node newRowNext)
	{
		this.rowNext = newRowNext;
	}
	
	public Node getRowNext()
	{
		return this.rowNext;
	}
	
	public void setColNext(Node newColNext)
	{
		this.colNext = newColNext;
	}
	
	public Node getColNext()
	{
		return this.colNext;
	}
	
}
